<div id="result">
<div class="div_header1">Messages</div>
<table cellspacing="0" id="mytable" width="100%" style="float: left;">
<thead>
<tr style="background:HoneyDew; height: 32px;">
<th align="left">Date</th>
<th>Sender</th>
<th>Recipient</th>
</tr>
</thead>
<tbody>
 <?php if(!empty ($allmsgs)){
 foreach($allmsgs as $allmsg):    
     ?>
<tr>
<td>
    <?php echo date('d-m-Y',  strtotime($allmsg['Message']['created'])); ?>
</td>
<td align="center">
    <?php echo $allmsg['Sender']['username']; ?>
</td>
<td align="center">
    <?php echo $allmsg['Recipient']['username']; ?>
</td>
</tr>
<tr>
<td colspan="3" style="border-bottom: 6px dotted gold;">
   <?php echo '<b>'.$allmsg['Sender']['username'].' '; ?>wrote:</b> <?php echo $allmsg['Message']['message']; ?>
</td>

</tr>
    <?php 
       endforeach;
    }else{ ?>
<tr>
<td colspan="3">
   No message found.
</td>
</tr>
<?php
}
?>
</tbody></table>
</div>